/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.alag.ci.webscrawler.test;

import com.alag.ci.webscrawler.*;
import java.util.*;
import org.junit.*;
import static org.junit.Assert.*;

/**
 *
 * @author sczbbx
 */
public class WebCrawlerText {
    
    public WebCrawlerText() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }
    
    @Before
    public void setUp() {
    }
    
    @After
    public void tearDown() {
    }
    // TODO add test methods here.
    // The methods must be annotated with annotation @Test. For example:
    //
    // @Test
    // public void hello() {}
    @Test
    public void Craw() {
        try {
            Queue<CrawlerUrl> urlQueue = new LinkedList<CrawlerUrl>();
            String url = "http://en.wikipedia.org/wiki/Collective_intelligence";
            String regexp = "collective.*intelligence";
            urlQueue.add(new CrawlerUrl(url, 0));
            NaiveCrawler crawler = new NaiveCrawler(urlQueue, 2, 2, 1000L, regexp);
            crawler.crawl();
        }
        catch (Throwable t) {
            System.out.println(t.toString());
        }
    }
}
